package model;

import java.lang.reflect.Field;
import java.util.List;

/**
 * 用于规则引擎处理
 *
 * @author zzy
 * @version V1.0
 * @since 2022/8/31
 */
public class SkillEvaluation {
    private String projectCode;
    // 焊接方法
    private String weldMethod;
    // 试件形式
    private String specimen;
    // 焊缝形式
    private String gap;
    // 填充材料
    private String material;
    // 药皮
    private String coating;
    // 焊接位置
    private String position;
    // 焊接要素
    private List<String> element;
    // 焊缝金属厚度
    private Float thickness;
    // 管试件外径
    private Float diameter;
    // 焊机型号
    private String machineType;

    public String getProjectCode() {
        return projectCode;
    }

    public void setProjectCode(String projectCode) {
        this.projectCode = projectCode;
    }

    public String getWeldMethod() {
        return weldMethod;
    }

    public void setWeldMethod(String weldMethod) {
        this.weldMethod = weldMethod;
    }

    public String getSpecimen() {
        return specimen;
    }

    public void setSpecimen(String specimen) {
        this.specimen = specimen;
    }

    public String getGap() {
        return gap;
    }

    public void setGap(String gap) {
        this.gap = gap;
    }

    public String getMaterial() {
        return material;
    }

    public void setMaterial(String material) {
        this.material = material;
    }

    public String getCoating() {
        return coating;
    }

    public void setCoating(String coating) {
        this.coating = coating;
    }

    public String getPosition() {
        return position;
    }

    public void setPosition(String position) {
        this.position = position;
    }

    public List<String> getElement() {
        return element;
    }

    public void setElement(List<String> element) {
        this.element = element;
    }

    public Float getThickness() {
        return thickness;
    }

    public void setThickness(Float thickness) {
        this.thickness = thickness;
    }

    public Float getDiameter() {
        return diameter;
    }

    public void setDiameter(Float diameter) {
        this.diameter = diameter;
    }

    public String getMachineType() {
        return machineType;
    }

    public void setMachineType(String machineType) {
        this.machineType = machineType;
    }

    // 反射打印非空字段
    @Override
    public String toString() {
        Class c = this.getClass();
        StringBuilder stringBuilder = new StringBuilder(c.getName() + ".toString：\n");
        Field[] fields = c.getDeclaredFields();
        try {
            for (Field field : fields) {
                if (null != field.get(this)) {
                    String tmp = field.get(this) + " ";
                    stringBuilder.append(tmp);
                }
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        return stringBuilder.toString();
    }

}
